--- orig/cx_Freeze-5.1.1/cx_Freeze/freezer.py	2017-12-09 23:11:29.000000000 +0100
+++ cx_Freeze-5.1.1/cx_Freeze/freezer.py	2018-08-31 13:41:19.028655982 +0200
@@ -550,13 +550,18 @@
             # the file is up to date so we can safely set this value to zero
             if module.code is not None:
                 if module.file is not None and os.path.exists(module.file):
-                    mtime = os.stat(module.file).st_mtime
+                   stat = os.stat(module.file)
+                   mtime = stat.st_mtime
+                   size = stat.st_size & 0xFFFFFFFF
                 else:
                     mtime = time.time()
+                    size = 0
                 if sys.version_info[:2] < (3, 3):
                     header = magic + struct.pack("<i", int(mtime))
+                elif sys.version_info[:2] == (3, 7):
+                    header = magic + struct.pack("<iii",0, int(mtime), size)
                 else:
-                    header = magic + struct.pack("<ii", int(mtime), 0)
+                    header = magic + struct.pack("<ii", int(mtime), size)
                 data = header + marshal.dumps(module.code)
 
             # if the module should be written to the file system, do so
